<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>model</title>
    <script src="https://unpkg.com/vue"></script>
</head>
<body>
<div id="app">
    <label for="">id:
    <input type="text" v-model="id"></label>
    <label for="">name:
    <input type="text" v-model="name"></label>
    <input type="button" value="添加" @click="add">
<p v-for="item in list" :key="item.id">

    {{item.id}}---{{item.name}}
</p>

</div>

</body>
<script>
    var vm = new Vue({
        el: '#app',
        data: {
            msg: '大家好哈哈哈哈，你们好啊。',
            id: '',
            name: '',
            list: [
                {id: 1, name: 'wuwenyuan1'},
                {id: 2, name: 'wuwenyuan2'},
                {id: 3, name: 'wuwenyuan3'}
            ]
        },
        methods: {
            add(){
                this.list.push({id: this.id, name: this.name})
            }
        }
    })
</script>
</html>